# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com>
pkgname=hurl
pkgver=4.1.0
pkgrel=0
pkgdesc="CLI to run HTTP requests defined in simple plain text format"
url="https://hurl.dev/"
arch="all"
license="Apache-2.0"
makedepends="cargo curl-dev libxml2-dev cargo-auditable"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/Orange-OpenSource/hurl/archive/refs/tags/$pkgver.tar.gz"
options="!check" # tests require a running local web server

prepare() {
	default_prepare
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

package() {
	install -Dm755 target/release/hurl target/release/hurlfmt -t "$pkgdir"/usr/bin/
	install -Dm644 docs/manual/hurl.1 docs/manual/hurlfmt.1 -t "$pkgdir"/usr/share/man/man1/
}

sha512sums="
6d84b770435ee935851c57a51d2eb1bfe2ba390e8e3ff05a808b541ce068984f127c359abdc7769723bc5c2d530d4bc3d3cd9cc3853e62e4d4ffa8363838be1f  hurl-4.1.0.tar.gz
"
